//
//  NWRstBaseModel.m
//  World
//
//  Created by longsan on 15/10/24.
//  Copyright © 2015年 小虫. All rights reserved.
//

#import "NWRstBaseModel.h"
#import "NWTaginfoBaseModel.h"
@implementation NWRstBaseModel

- (instancetype)init
{
    self = [super init];
    if (self) {
        
        _authorModel = [[NWAuthor_listBaseModel alloc] init];
        _taginfoArray = [NSMutableArray arrayWithCapacity:0];
    }
    return self;
}

- (void)setValue:(id)value forKey:(NSString *)key
{
    if ([key isEqualToString:@"author_list"]) {
        NSDictionary *dict = value[0];
        [self.authorModel setValuesForKeysWithDictionary:dict];
        
    } else if ([key isEqualToString:@"description"]) {
        self.descriptions = value;
    } else if ([key isEqualToString:@"id"]) {
        self.ID = value;
    }else if ([key isEqualToString:@"taginfo"]) {
        for (NSDictionary *dict in value) {
            NWTaginfoBaseModel *model = [[NWTaginfoBaseModel alloc] init];
            [model setValuesForKeysWithDictionary:dict];
            [self.taginfoArray addObject:model];
        }
    }
    else{
         [super setValue:value forKey:key];
    }
    
    
}


@end
